//
//  NSMutableDictionary+extension.m
//  YouKuDylib
//
//  Created by iMac on 2018/7/17.
//

#import "NSMutableDictionary+extension.h"
#import <objc/runtime.h>

@implementation NSMutableDictionary (extension)
+ (void)load
{
	static dispatch_once_t onceToken;
	dispatch_once(&onceToken, ^{
		Method method1 = class_getInstanceMethod(NSClassFromString(@"__NSDictionaryM"), @selector(setObject:forKeyedSubscript:));
		Method method2 = class_getInstanceMethod(NSClassFromString(@"__NSDictionaryM"), @selector(yty_setObject:forKeyedSubscript:));
		method_exchangeImplementations(method1, method2);
	});
}

- (void)yty_setObject:(id)obj forKeyedSubscript:(id<NSCopying>)key
{
	if (!key) return;
	[self yty_setObject:obj forKeyedSubscript:key];
}

@end
